package com.ymdx.util.tool;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by yangliwei on 2017/8/12.
 */
public class Tools {
    /**
     * 是否为手机号
     * @param mobiles
     * @return true 手机号格式正确
     */
    public static boolean isMobile(String mobiles) {
        Pattern p = Pattern.compile("^((13[0-9])|(14[5|7|9])|(15([0-3]|[5-9]))|(17([1-3]|[5-8]))|(18[0-9]))\\d{8}$");
        Matcher m = p.matcher(mobiles);
        return m.matches();
    }
}
